Starbucks Capstone Challenge

Introduction

This data set contains simulated data that mimics customer behavior on the Starbucks rewards mobile app. Once every few days, Starbucks sends out an offer to users of the mobile app. An offer can be merely an advertisement for a drink or an actual offer such as a discount or BOGO (buy one get one free). Some users might not receive any offer during certain weeks.

Not all users receive the same offer, and that is the challenge to solve with this data set.

Your task is to combine transaction, demographic and offer data to determine which demographic groups respond best to which offer type. This data set is a simplified version of the real Starbucks app because the underlying simulator only has one product whereas Starbucks actually sells dozens of products.

Every offer has a validity period before the offer expires. As an example, a BOGO offer might be valid for only 5 days. You'll see in the data set that informational offers have a validity period even though these ads are merely providing information about a product; for example, if an informational offer has 7 days of validity, you can assume the customer is feeling the influence of the offer for 7 days after receiving the advertisement.

You'll be given transactional data showing user purchases made on the app including the timestamp of purchase and the amount of money spent on a purchase. This transactional data also has a record for each offer that a user receives as well as a record for when a user actually views the offer. There are also records for when a user completes an offer.

Keep in mind as well that someone using the app might make a purchase through the app without having received an offer or seen an offer.

Example

To give an example, a user could receive a discount offer buy 10 dollars get 2 off on Monday. The offer is valid for 10 days from receipt. If the customer accumulates at least 10 dollars in purchases during the validity period, the customer completes the offer.

However, there are a few things to watch out for in this data set. Customers do not opt into the offers that they receive; in other words, a user can receive an offer, never actually view the offer, and still complete the offer. For example, a user might receive the "buy 10 dollars get 2 dollars off offer", but the user never opens the offer during the 10 day validity period. The customer spends 15 dollars during those ten days. There will be an offer completion record in the data set; however, the customer was not influenced by the offer because the customer never viewed the offer.

Cleaning

This makes data cleaning especially important and tricky.

You'll also want to take into account that some demographic groups will make purchases even if they don't receive an offer. From a business perspective, if a customer is going to make a 10 dollar purchase without an offer anyway, you wouldn't want to send a buy 10 dollars get 2 dollars off offer. You'll want to try to assess what a certain demographic group will buy when not receiving any offers.

Final Advice

Because this is a capstone project, you are free to analyze the data any way you see fit. For example, you could build a machine learning model that predicts how much someone will spend based on demographics and offer type. Or you could build a model that predicts whether or not someone will respond to an offer. Or, you don't need to build a machine learning model at all. You could develop a set of heuristics that determine what offer you should send to each customer (i.e., 75 percent of women customers who were 35 years old responded to offer A vs 40 percent from the same demographic to offer B, so send offer A).

Data Sets

The data is contained in three files:

  • portfolio.json - containing offer ids and meta data about each offer (duration, type, etc.)
  • profile.json - demographic data for each customer
  • transcript.json - records for transactions, offers received, offers viewed, and offers completed

Here is the schema and explanation of each variable in the files:

portfolio.json

  • id (string) - offer id
  • offer_type (string) - type of offer ie BOGO, discount, informational
  • difficulty (int) - minimum required spend to complete an offer
  • reward (int) - reward given for completing an offer
  • duration (int) - time for offer to be open, in days
  • channels (list of strings)

profile.json

  • age (int) - age of the customer
  • became_member_on (int) - date when customer created an app account
  • gender (str) - gender of the customer (note some entries contain 'O' for other rather than M or F)
  • id (str) - customer id
  • income (float) - customer's income

transcript.json

  • event (str) - record description (ie transaction, offer received, offer viewed, etc.)
  • person (str) - customer id
  • time (int) - time in hours since start of test. The data begins at time t=0
  • value - (dict of strings) - either an offer id or transaction amount depending on the record

Note: If you are using the workspace, you will need to go to the terminal and run the command conda update pandas before reading in the files. This is because the version of pandas in the workspace cannot read in the transcript.json file correctly, but the newest version of pandas can. You can access the termnal from the orange icon in the top left of this notebook.

You can see how to access the terminal and how the install works using the two images below. First you need to access the terminal:

Then you will want to run the above command:

Finally, when you enter back into the notebook (use the jupyter icon again), you should be able to run the below cell without any errors.

In [1]:
# import libraries here; add more as necessary
import numpy as np
import pandas as pd
import math
import json
import pickle
from datetime import datetime as dt
from IPython.display import display, HTML
import plotly
import matplotlib.pyplot as plt
import seaborn as sns
import re
# magic word for producing visualizations in notebook
%matplotlib inline
from sklearn import preprocessing as p
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from sklearn.metrics import classification_report
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline, FeatureUnion

from sklearn.ensemble import AdaBoostClassifier
from sklearn import svm

import sys
np.set_printoptions(threshold=sys.maxsize)
print(sys.version)

# Set figure width to 12 and height to 9
fig_size = plt.rcParams["figure.figsize"]
fig_size[0] = 15
fig_size[1] = 10
plt.rcParams["figure.figsize"] = fig_size
pd.set_option('display.max_columns', 500)
import chart_studio as py
import plotly.graph_objects as go
import plotly.io as pio
import plotly.express as px
from plotly.subplots import make_subplots
3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0]

Load Data:

In [2]:
# read in the json files
portfolio = pd.read_json('data/portfolio.json', orient='records', lines=True)
profile = pd.read_json('data/profile.json', orient='records', lines=True)
transcript = pd.read_json('data/transcript.json', orient='records', lines=True)
In [3]:
portfolio
Out[3]:
channels difficulty duration id offer_type reward
0 [email, mobile, social] 10 7 ae264e3637204a6fb9bb56bc8210ddfd bogo 10
1 [web, email, mobile, social] 10 5 4d5c57ea9a6940dd891ad53e9dbe8da0 bogo 10
2 [web, email, mobile] 0 4 3f207df678b143eea3cee63160fa8bed informational 0
3 [web, email, mobile] 5 7 9b98b8c7a33c4b65b9aebfe6a799e6d9 bogo 5
4 [web, email] 20 10 0b1e1539f2cc45b7b9fa7c272da2e1d7 discount 5
5 [web, email, mobile, social] 7 7 2298d6c36e964ae4a3e7e9706d1fb8c2 discount 3
6 [web, email, mobile, social] 10 10 fafdcd668e3743c1bb461111dcafc2a4 discount 2
7 [email, mobile, social] 0 3 5a8bc65990b245e5a138643cd4eb9837 informational 0
8 [web, email, mobile, social] 5 5 f19421c1d4aa40978ebb69ca19b0e20d bogo 5
9 [web, email, mobile] 10 7 2906b810c7d4411798c6938adc9daaa5 discount 2
In [4]:
profile
Out[4]:
age became_member_on gender id income
0 118 20170212 None 68be06ca386d4c31939f3a4f0e3dd783 NaN
1 55 20170715 F 0610b486422d4921ae7d2bf64640c50b 112000.0
2 118 20180712 None 38fe809add3b4fcf9315a9694bb96ff5 NaN
3 75 20170509 F 78afa995795e4d85b5d9ceeca43f5fef 100000.0
4 118 20170804 None a03223e636434f42ac4c3df47e8bac43 NaN
5 68 20180426 M e2127556f4f64592b11af22de27a7932 70000.0
6 118 20170925 None 8ec6ce2a7e7949b1bf142def7d0e0586 NaN
7 118 20171002 None 68617ca6246f4fbc85e91a2a49552598 NaN
8 65 20180209 M 389bc3fa690240e798340f5a15918d5c 53000.0
9 118 20161122 None 8974fc5686fe429db53ddde067b88302 NaN
10 118 20170824 None c4863c7985cf408faee930f111475da3 NaN
11 118 20150919 None 148adfcaa27d485b82f323aaaad036bd NaN
12 58 20171111 M 2eeac8d8feae4a8cad5a6af0499a211d 51000.0
13 61 20170911 F aa4862eba776480b8bb9c68455b8c2e1 57000.0
14 26 20140213 M e12aeaf2d47d42479ea1c4ac3d8286c6 46000.0
15 62 20160211 F 31dda685af34476cad5bc968bdb01c53 71000.0
16 49 20141113 M 62cf5e10845442329191fc246e7bcea3 52000.0
17 118 20170801 None 744d603ef08c4f33af5a61c8c7628d1c NaN
18 57 20171231 M 6445de3b47274c759400cd68131d91b4 42000.0
19 61 20180501 F a448667f336b42c9a66fc5ffd5d73772 40000.0
20 40 20160504 F 440cf1fd7580490c971d8c651ed962af 71000.0
21 64 20170909 M 4b0da7e80e5945209a1fdddfe813dbe0 100000.0
22 78 20170616 F c27e0d6ab72c455a8bb66d980963de60 71000.0
23 118 20170907 None 2b826eba31074a059d63b0ae8f50b7d5 NaN
24 42 20130811 M f806632c011441378d4646567f357a21 69000.0
25 56 20180428 F d058f73bf8674a26a95227db098147b1 88000.0
26 118 20170330 None 65aba5c617294649aeb624da249e1ee5 NaN
27 33 20170926 F c6c9884912c645429f3333f912b55f44 52000.0
28 46 20170911 F 7429a044884842d6862f516c38b1156f 59000.0
29 59 20150121 M ebe7ef46ea6f4963a7dd49f501b26779 41000.0
... ... ... ... ... ...
16970 67 20151107 M a2e6029e17b6466187a40b66e333a73e 94000.0
16971 52 20180522 F 6e71b66784844d1ab8376ac8ab096d4b 75000.0
16972 44 20170119 F e2fd53ed790240c586b3188f23542cca 51000.0
16973 30 20151012 M 08eb126ad33f447ca3ad076482445c05 57000.0
16974 59 20160113 F f88e91a11d8f405b9a47ad3741415b83 71000.0
16975 61 20171231 F 1b4df4b48bf64727a4c445909aea1251 81000.0
16976 39 20160921 F 122c0c2a3c2540848f8c3fdc37e97639 54000.0
16977 118 20160609 None eb7dd979f4644052a5c401a01f129132 NaN
16978 29 20170220 F 54bead4179c44b71acc4e8398181d183 58000.0
16979 63 20130922 F a00058cf10334a308c68e7631c529907 52000.0
16980 118 20160901 None 5c686d09ca4d475a8f750f2ba07e0440 NaN
16981 84 20160629 M 1966fa40d2f84620b2b1b9b64f8e0209 93000.0
16982 118 20160415 None d9ca82f550ac4ee58b6299cf1e5c824a NaN
16983 72 20150404 F ff737c250d2343729ade04c4f6eb1001 65000.0
16984 75 20160716 F 392d23b2c958493197f647bedfe4f418 78000.0
16985 26 20180619 M 97ee6e7a12fe4064b260fa48bdd0330f 55000.0
16986 59 20170731 F bf3069b178fe40d789dd027901bc406b 63000.0
16987 57 20160709 M 76ddbd6576844afe811f1a3c0fbb5bec 40000.0
16988 64 20180104 M f653cf2d8bba42d0a53c2937ee2e5893 51000.0
16989 118 20180305 None ca45ee1883624304bac1e4c8a114f045 NaN
16990 70 20160310 F 79edb810789c447e8d212a324b44cc16 39000.0
16991 118 20160116 None a9a20fa8b5504360beb4e7c8712f8306 NaN
16992 21 20170917 F 400d0536e8794cbb855b0d882d67cbda 72000.0
16993 60 20180505 M cb23b66c56f64b109d673d5e56574529 113000.0
16994 118 20151211 None c02b10e8752c4d8e9b73f918558531f7 NaN
16995 45 20180604 F 6d5f3a774f3d4714ab0c092238f3a1d7 54000.0
16996 61 20180713 M 2cb4f97358b841b9a9773a7aa05a9d77 72000.0
16997 49 20170126 M 01d26f638c274aa0b965d24cefe3183f 73000.0
16998 83 20160307 F 9dc1421481194dcd9400aec7c9ae6366 50000.0
16999 62 20170722 F e4052622e5ba45a8b96b59aba68cf068 82000.0

17000 rows × 5 columns

In [5]:
transcript
Out[5]:
event person time value
0 offer received 78afa995795e4d85b5d9ceeca43f5fef 0 {'offer id': '9b98b8c7a33c4b65b9aebfe6a799e6d9'}
1 offer received a03223e636434f42ac4c3df47e8bac43 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
2 offer received e2127556f4f64592b11af22de27a7932 0 {'offer id': '2906b810c7d4411798c6938adc9daaa5'}
3 offer received 8ec6ce2a7e7949b1bf142def7d0e0586 0 {'offer id': 'fafdcd668e3743c1bb461111dcafc2a4'}
4 offer received 68617ca6246f4fbc85e91a2a49552598 0 {'offer id': '4d5c57ea9a6940dd891ad53e9dbe8da0'}
5 offer received 389bc3fa690240e798340f5a15918d5c 0 {'offer id': 'f19421c1d4aa40978ebb69ca19b0e20d'}
6 offer received c4863c7985cf408faee930f111475da3 0 {'offer id': '2298d6c36e964ae4a3e7e9706d1fb8c2'}
7 offer received 2eeac8d8feae4a8cad5a6af0499a211d 0 {'offer id': '3f207df678b143eea3cee63160fa8bed'}
8 offer received aa4862eba776480b8bb9c68455b8c2e1 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
9 offer received 31dda685af34476cad5bc968bdb01c53 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
10 offer received 744d603ef08c4f33af5a61c8c7628d1c 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
11 offer received 3d02345581554e81b7b289ab5e288078 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
12 offer received 4b0da7e80e5945209a1fdddfe813dbe0 0 {'offer id': 'ae264e3637204a6fb9bb56bc8210ddfd'}
13 offer received c27e0d6ab72c455a8bb66d980963de60 0 {'offer id': '3f207df678b143eea3cee63160fa8bed'}
14 offer received d53717f5400c4e84affdaeda9dd926b3 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
15 offer received f806632c011441378d4646567f357a21 0 {'offer id': 'fafdcd668e3743c1bb461111dcafc2a4'}
16 offer received d058f73bf8674a26a95227db098147b1 0 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
17 offer received 65aba5c617294649aeb624da249e1ee5 0 {'offer id': '2906b810c7d4411798c6938adc9daaa5'}
18 offer received ebe7ef46ea6f4963a7dd49f501b26779 0 {'offer id': '9b98b8c7a33c4b65b9aebfe6a799e6d9'}
19 offer received 1e9420836d554513ab90eba98552d0a9 0 {'offer id': 'ae264e3637204a6fb9bb56bc8210ddfd'}
20 offer received 868317b9be554cb18e50bc68484749a2 0 {'offer id': '2906b810c7d4411798c6938adc9daaa5'}
21 offer received f082d80f0aac47a99173ba8ef8fc1909 0 {'offer id': '9b98b8c7a33c4b65b9aebfe6a799e6d9'}
22 offer received 102e9454054946fda62242d2e176fdce 0 {'offer id': '4d5c57ea9a6940dd891ad53e9dbe8da0'}
23 offer received 4beeb3ed64dd4898b0edf2f6b67426d3 0 {'offer id': '2906b810c7d4411798c6938adc9daaa5'}
24 offer received 9f30b375d7bd4c62a884ffe7034e09ee 0 {'offer id': '2298d6c36e964ae4a3e7e9706d1fb8c2'}
25 offer received 25c906289d154b66bf579693f89481c9 0 {'offer id': '2906b810c7d4411798c6938adc9daaa5'}
26 offer received 6e014185620b49bd98749f728747572f 0 {'offer id': 'f19421c1d4aa40978ebb69ca19b0e20d'}
27 offer received 02c083884c7d45b39cc68e1314fec56c 0 {'offer id': 'ae264e3637204a6fb9bb56bc8210ddfd'}
28 offer received c0d210398dee4a0895b24444a5fcd1d2 0 {'offer id': '9b98b8c7a33c4b65b9aebfe6a799e6d9'}
29 offer received 8be4463721e14d7fa600686bf8c8b2ed 0 {'offer id': 'fafdcd668e3743c1bb461111dcafc2a4'}
... ... ... ... ...
306504 transaction 8524d450673b4c24869b6c94380006de 714 {'amount': 4.89}
306505 transaction b895c57e8cd047a8872ce02aa54759d6 714 {'amount': 4.48}
306506 offer completed b895c57e8cd047a8872ce02aa54759d6 714 {'offer_id': 'fafdcd668e3743c1bb461111dcafc2a4...
306507 offer viewed 8dda575c2a1d44b9ac8e8b07b93d1f8e 714 {'offer id': '0b1e1539f2cc45b7b9fa7c272da2e1d7'}
306508 transaction 8431c16f8e1d440880db371a68f82dd0 714 {'amount': 1.19}
306509 offer completed 8431c16f8e1d440880db371a68f82dd0 714 {'offer_id': 'fafdcd668e3743c1bb461111dcafc2a4...
306510 transaction ba620885e51c4b0ea64a4f61daad494f 714 {'amount': 14.31}
306511 transaction a1a8f40407c444cc848468275308958a 714 {'amount': 2.37}
306512 transaction 8d80970192fa496f99d6b45c470a4b60 714 {'amount': 6.92}
306513 transaction bde275066f3c4fa0bff3093e3b866a2c 714 {'amount': 12.73}
306514 transaction f1e4fd36e5a0446f83861308bddf6945 714 {'amount': 8.2}
306515 transaction 0b64be3b241c4407a5c9a71781173829 714 {'amount': 2.6}
306516 transaction 86d03d35d7e0434b935e7743e83be3a0 714 {'amount': 9.2}
306517 transaction 3408fd05c781401f8442fb6dbaaea9c7 714 {'amount': 11.7}
306518 transaction 1593d617fac246ef8e50dbb0ffd77f5f 714 {'amount': 40.67}
306519 transaction f1b31d07b5d84f69a2d5f1d07843989e 714 {'amount': 31.13}
306520 transaction 2ce987015ec0404a97ba333e8e814090 714 {'amount': 1.6400000000000001}
306521 transaction 2e33545f0a764d27b2ccff95fc8d72c4 714 {'amount': 17.35}
306522 transaction d1c4500ace2e45e9a45d3cd2fccac8d8 714 {'amount': 4.42}
306523 transaction b65affd9e07346a1906364a396950e3d 714 {'amount': 18.35}
306524 transaction d613ca9c59dd42f497bdbf6178da54a7 714 {'amount': 25.14}
306525 transaction eec70ab28af74a22a4aeb889c0317944 714 {'amount': 43.58}
306526 transaction 24f56b5e1849462093931b164eb803b5 714 {'amount': 22.64}
306527 offer completed 24f56b5e1849462093931b164eb803b5 714 {'offer_id': 'fafdcd668e3743c1bb461111dcafc2a4...
306528 transaction 5ca2620962114246ab218fc648eb3934 714 {'amount': 2.2}
306529 transaction b3a1272bc9904337b331bf348c3e8c17 714 {'amount': 1.5899999999999999}
306530 transaction 68213b08d99a4ae1b0dcb72aebd9aa35 714 {'amount': 9.53}
306531 transaction a00058cf10334a308c68e7631c529907 714 {'amount': 3.61}
306532 transaction 76ddbd6576844afe811f1a3c0fbb5bec 714 {'amount': 3.5300000000000002}
306533 transaction c02b10e8752c4d8e9b73f918558531f7 714 {'amount': 4.05}

306534 rows × 4 columns

Data Exploration:

In [6]:
# since any offer just started does not have any effect on the user therefore on our analysis and its outcome,
# we will take any transcript item with time = 0 from the transcript dataframe.
transcript.shape[0] - transcript[transcript['time']!=0].shape[0]
Out[6]:
15561
In [7]:
profile.describe()
Out[7]:
age became_member_on income
count 17000.000000 1.700000e+04 14825.000000
mean 62.531412 2.016703e+07 65404.991568
std 26.738580 1.167750e+04 21598.299410
min 18.000000 2.013073e+07 30000.000000
25% 45.000000 2.016053e+07 49000.000000
50% 58.000000 2.017080e+07 64000.000000
75% 73.000000 2.017123e+07 80000.000000
max 118.000000 2.018073e+07 120000.000000
In [8]:
transcript.describe()
Out[8]:
time
count 306534.000000
mean 366.382940
std 200.326314
min 0.000000
25% 186.000000
50% 408.000000
75% 528.000000
max 714.000000

Feature Engineering:

In [9]:
def get_days(item_time_in_hours):
    item_days = int(round(item_time_in_hours / 24))
    return item_days
In [10]:
def extract_key_value(item_value):
    value_key = list(item_value)[0]
    item_amount = ''
    item_offer_id = ''
    if value_key == 'amount':
        item_amount = item_value[value_key]
    if value_key == 'offer id':
        item_offer_id = item_value[value_key]
    if value_key == 'offer_id':
        item_offer_id = item_value[value_key]
    return pd.Series([item_amount, item_offer_id])
In [11]:
def extract_event(item_event):
    offer_received = 0
    offer_viewed = 0
    offer_completed = 0
    transaction = 0
    if item_event == 'offer received':
        offer_received = 1
    if item_event == 'offer viewed':
        offer_viewed = 1
    if item_event == 'offer completed':
        offer_completed = 1
    if item_event == 'transaction':
        transaction = 1
    return pd.Series([offer_received, offer_viewed, offer_completed, transaction])
In [12]:
def clean_transcript(transcript_df):
    transcript_cleaned_df = transcript_df.copy()
    transcript_cleaned_df = transcript_cleaned_df[transcript_cleaned_df['time']!=0]
    transcript_cleaned_df[['transaction_amount','offer_id']] = transcript_cleaned_df.apply(lambda x: extract_key_value(x['value']), axis=1)
    transcript_cleaned_df[['offer_status_received', 'offer_status_viewed','offer_status_completed', 'transaction']] = transcript_cleaned_df.apply(lambda x: extract_event(x['event']), axis=1)
    transcript_cleaned_df['offer_days'] = transcript_cleaned_df.apply(lambda x: get_days(x['time']), axis=1)
    transcript_cleaned_df['user_id'] = transcript_cleaned_df['person']
    transcript_cleaned_df.drop(['event','time','value','person'], axis=1, inplace=True)
    transcript_cleaned_df = transcript_cleaned_df[['user_id','offer_id','transaction_amount','offer_days', 'offer_status_received','offer_status_viewed','offer_status_completed']]

    return transcript_cleaned_df
In [13]:
transcript_df = clean_transcript(transcript)
In [14]:
transcript_df
Out[14]:
user_id offer_id transaction_amount offer_days offer_status_received offer_status_viewed offer_status_completed
15561 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0
15562 a03223e636434f42ac4c3df47e8bac43 0b1e1539f2cc45b7b9fa7c272da2e1d7 0 0 1 0
15563 102e9454054946fda62242d2e176fdce 19.88 0 0 0 0
15564 102e9454054946fda62242d2e176fdce 4d5c57ea9a6940dd891ad53e9dbe8da0 0 0 0 1
15565 02c083884c7d45b39cc68e1314fec56c 1.44 0 0 0 0
15566 be8a5d1981a2458d90b255ddc7e0d174 2.63 0 0 0 0
15567 7584948ea6d04f94b8798624706261c2 4d5c57ea9a6940dd891ad53e9dbe8da0 0 0 1 0
15568 a5a6ef2b78a04ddc9f374dd7c7f60bff 5a8bc65990b245e5a138643cd4eb9837 0 0 1 0
15569 8045834137dc47faa24f2c4547969f33 f19421c1d4aa40978ebb69ca19b0e20d 0 0 1 0
15570 571b739ada3041fb8fbd20f23ce034f7 4d5c57ea9a6940dd891ad53e9dbe8da0 0 0 1 0
15571 a9780228a1d04539afdee8b745e4be10 fafdcd668e3743c1bb461111dcafc2a4 0 0 1 0
15572 13033baa9d294c3c9165a00d71b72614 2906b810c7d4411798c6938adc9daaa5 0 0 1 0
15573 2cf5895bddf9467e878c6d51a622d5fb f19421c1d4aa40978ebb69ca19b0e20d 0 0 1 0
15574 6747dda08bed46298c23e05b64820a3a 7.32 0 0 0 0
15575 f35b342b24734da18a830bb9329a4fbd 4d5c57ea9a6940dd891ad53e9dbe8da0 0 0 1 0
15576 37a97f6e09784a07bbb67bc6539f1a00 3f207df678b143eea3cee63160fa8bed 0 0 1 0
15577 37a97f6e09784a07bbb67bc6539f1a00 24.25 0 0 0 0
15578 fe97aa22dd3e48c8b143116a8403dd52 fafdcd668e3743c1bb461111dcafc2a4 0 0 1 0
15579 d7dc31e069124ef49e1bb937cb89f41c 4d5c57ea9a6940dd891ad53e9dbe8da0 0 0 1 0
15580 d250372c924747d8ac9a8fa88f584bc3 f19421c1d4aa40978ebb69ca19b0e20d 0 0 1 0
15581 d1a6fe4c241e4dbf8a4da6fd6c714ac5 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0
15582 ae47fbe72b274838a2093c3e91bc03dc ae264e3637204a6fb9bb56bc8210ddfd 0 0 1 0
15583 e737ff591120415581ddbe817b8c82ca 23.27 0 0 0 0
15584 32189735a963491082e35dd4c3221690 21.22 0 0 0 0
15585 18174519037241e9b1ddcb627ca4dc41 5a8bc65990b245e5a138643cd4eb9837 0 0 1 0
15586 031387fa9cfd47e88f4e4b4b4cb71925 fafdcd668e3743c1bb461111dcafc2a4 0 0 1 0
15587 09e7e40eb89943458f4f79fe2e023dd6 fafdcd668e3743c1bb461111dcafc2a4 0 0 1 0
15588 c894971c9e414a358b84255199727636 2298d6c36e964ae4a3e7e9706d1fb8c2 0 0 1 0
15589 c894971c9e414a358b84255199727636 6.97 0 0 0 0
15590 00c6035df45840038a72766c6d27a0db fafdcd668e3743c1bb461111dcafc2a4 0 0 1 0
... ... ... ... ... ... ... ...
306504 8524d450673b4c24869b6c94380006de 4.89 30 0 0 0
306505 b895c57e8cd047a8872ce02aa54759d6 4.48 30 0 0 0
306506 b895c57e8cd047a8872ce02aa54759d6 fafdcd668e3743c1bb461111dcafc2a4 30 0 0 1
306507 8dda575c2a1d44b9ac8e8b07b93d1f8e 0b1e1539f2cc45b7b9fa7c272da2e1d7 30 0 1 0
306508 8431c16f8e1d440880db371a68f82dd0 1.19 30 0 0 0
306509 8431c16f8e1d440880db371a68f82dd0 fafdcd668e3743c1bb461111dcafc2a4 30 0 0 1
306510 ba620885e51c4b0ea64a4f61daad494f 14.31 30 0 0 0
306511 a1a8f40407c444cc848468275308958a 2.37 30 0 0 0
306512 8d80970192fa496f99d6b45c470a4b60 6.92 30 0 0 0
306513 bde275066f3c4fa0bff3093e3b866a2c 12.73 30 0 0 0
306514 f1e4fd36e5a0446f83861308bddf6945 8.2 30 0 0 0
306515 0b64be3b241c4407a5c9a71781173829 2.6 30 0 0 0
306516 86d03d35d7e0434b935e7743e83be3a0 9.2 30 0 0 0
306517 3408fd05c781401f8442fb6dbaaea9c7 11.7 30 0 0 0
306518 1593d617fac246ef8e50dbb0ffd77f5f 40.67 30 0 0 0
306519 f1b31d07b5d84f69a2d5f1d07843989e 31.13 30 0 0 0
306520 2ce987015ec0404a97ba333e8e814090 1.64 30 0 0 0
306521 2e33545f0a764d27b2ccff95fc8d72c4 17.35 30 0 0 0
306522 d1c4500ace2e45e9a45d3cd2fccac8d8 4.42 30 0 0 0
306523 b65affd9e07346a1906364a396950e3d 18.35 30 0 0 0
306524 d613ca9c59dd42f497bdbf6178da54a7 25.14 30 0 0 0
306525 eec70ab28af74a22a4aeb889c0317944 43.58 30 0 0 0
306526 24f56b5e1849462093931b164eb803b5 22.64 30 0 0 0
306527 24f56b5e1849462093931b164eb803b5 fafdcd668e3743c1bb461111dcafc2a4 30 0 0 1
306528 5ca2620962114246ab218fc648eb3934 2.2 30 0 0 0
306529 b3a1272bc9904337b331bf348c3e8c17 1.59 30 0 0 0
306530 68213b08d99a4ae1b0dcb72aebd9aa35 9.53 30 0 0 0
306531 a00058cf10334a308c68e7631c529907 3.61 30 0 0 0
306532 76ddbd6576844afe811f1a3c0fbb5bec 3.53 30 0 0 0
306533 c02b10e8752c4d8e9b73f918558531f7 4.05 30 0 0 0

290973 rows × 7 columns

In [15]:
portfolio
Out[15]:
channels difficulty duration id offer_type reward
0 [email, mobile, social] 10 7 ae264e3637204a6fb9bb56bc8210ddfd bogo 10
1 [web, email, mobile, social] 10 5 4d5c57ea9a6940dd891ad53e9dbe8da0 bogo 10
2 [web, email, mobile] 0 4 3f207df678b143eea3cee63160fa8bed informational 0
3 [web, email, mobile] 5 7 9b98b8c7a33c4b65b9aebfe6a799e6d9 bogo 5
4 [web, email] 20 10 0b1e1539f2cc45b7b9fa7c272da2e1d7 discount 5
5 [web, email, mobile, social] 7 7 2298d6c36e964ae4a3e7e9706d1fb8c2 discount 3
6 [web, email, mobile, social] 10 10 fafdcd668e3743c1bb461111dcafc2a4 discount 2
7 [email, mobile, social] 0 3 5a8bc65990b245e5a138643cd4eb9837 informational 0
8 [web, email, mobile, social] 5 5 f19421c1d4aa40978ebb69ca19b0e20d bogo 5
9 [web, email, mobile] 10 7 2906b810c7d4411798c6938adc9daaa5 discount 2
In [16]:
def get_channels(item_channels):
    web = 0
    email = 0
    mobile = 0
    social = 0
    for i in item_channels:
        if i == 'web':
            web = 1
        if i == 'email':
            email = 1
        if i == 'mobile':
            mobile = 1
        if i == 'social':
            social = 1
    return  pd.Series([web, email, mobile, social])
In [17]:
def get_offer_type(offer_type):
    bogo = 0
    discount = 0
    informational = 0
    if offer_type == 'bogo':
        bogo = 1
    if offer_type == 'discount':
        discount = 1
    if offer_type == 'informational':
        informational = 1
    return  pd.Series([bogo, discount, informational])
In [18]:
def clean_portfolio(portfolio_df):
    portfolio_df_clean = portfolio_df.copy()
    offer_ids_list = list(pd.get_dummies(portfolio_df_clean['id'], prefix='offer_id_'))
    offer_ids_dummies = pd.get_dummies(portfolio_df_clean['id'], prefix='offer_id_')
    portfolio_df_clean[offer_ids_list] = offer_ids_dummies        
    portfolio_df_clean[['web', 'email', 'mobile', 'social']] = portfolio_df_clean.apply(lambda x: get_channels(x['channels']), axis=1)
    portfolio_df_clean[['bogo', 'discount', 'informational']] = portfolio_df_clean.apply(lambda x: get_offer_type(x['offer_type']), axis=1)
    portfolio_df_clean.drop(['channels'], axis=1, inplace=True)
    portfolio_df_clean.drop(['offer_type'], axis=1, inplace=True)
    portfolio_df_clean['offer_id'] = portfolio_df_clean['id']
    portfolio_df_clean['offer_duration'] = portfolio_df_clean['duration']
    portfolio_df_clean['offer_difficulty'] = portfolio_df_clean['difficulty']
    portfolio_df_clean['offer_reward'] = portfolio_df_clean['reward']
    portfolio_df_clean['offer_type_bogo'] = portfolio_df_clean['bogo']
    portfolio_df_clean['offer_type_discount'] = portfolio_df_clean['discount']
    portfolio_df_clean['offer_type_informational'] = portfolio_df_clean['informational']
    portfolio_df_clean['offer_channel_web'] = portfolio_df_clean['web']
    portfolio_df_clean['offer_channel_email'] = portfolio_df_clean['email']
    portfolio_df_clean['offer_channel_mobile'] = portfolio_df_clean['mobile']
    portfolio_df_clean['offer_channel_social'] = portfolio_df_clean['social']
    portfolio_df_clean = portfolio_df_clean[['offer_id','offer_duration','offer_difficulty','offer_reward','offer_type_bogo','offer_type_discount','offer_type_informational','offer_channel_web','offer_channel_email','offer_channel_mobile','offer_channel_social'] + offer_ids_list]
    return portfolio_df_clean
In [19]:
portfolio_df = clean_portfolio(portfolio)
In [20]:
portfolio_df
Out[20]:
offer_id offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4
0 ae264e3637204a6fb9bb56bc8210ddfd 7 10 10 1 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0
1 4d5c57ea9a6940dd891ad53e9dbe8da0 5 10 10 1 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0
2 3f207df678b143eea3cee63160fa8bed 4 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0
3 9b98b8c7a33c4b65b9aebfe6a799e6d9 7 5 5 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0
4 0b1e1539f2cc45b7b9fa7c272da2e1d7 10 20 5 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0
5 2298d6c36e964ae4a3e7e9706d1fb8c2 7 7 3 0 1 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0
6 fafdcd668e3743c1bb461111dcafc2a4 10 10 2 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1
7 5a8bc65990b245e5a138643cd4eb9837 3 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0
8 f19421c1d4aa40978ebb69ca19b0e20d 5 5 5 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0
9 2906b810c7d4411798c6938adc9daaa5 7 10 2 0 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0
In [21]:
profile['age'].describe()
Out[21]:
count    17000.000000
mean        62.531412
std         26.738580
min         18.000000
25%         45.000000
50%         58.000000
75%         73.000000
max        118.000000
Name: age, dtype: float64
In [22]:
profile['age'].hist()
Out[22]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fc91ba97780>
In [23]:
profile['income'].hist()
Out[23]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fc91ba5aa58>
In [24]:
gender_group = ['user_gender_F', 'user_gender_M', 'user_gender_O']
gender_group_info = ['Male','Female', 'Other']

age_group = ['user_age_group_1', 'user_age_group_2', 'user_age_group_3', 'user_age_group_4', 'user_age_group_5', 'user_age_group_6', 'user_age_group_7']
age_group_info = ['21 or younger','25 - 22', '35 - 26', '45 - 36', '55 - 46', '65 - 56', '66 or older']

loyality_group = ['user_loyality_group_1', 'user_loyality_group_2', 'user_loyality_group_3', 'user_loyality_group_4', 'user_loyality_group_5', 'user_loyality_group_6', 'user_loyality_group_7']
loyality_group_info = ['2013 or newer','2014 - 2013', '2015 - 2014', '2016 - 2015', '2017 - 2016', '2018 - 2017', '2018 or newer']

income_group = ['user_income_group_1', 'user_income_group_2', 'user_income_group_3', 'user_income_group_4', 'user_income_group_5', 'user_income_group_6', 'user_income_group_7']
income_group_info = ['35k or less','45k - 36k', '65k - 46k', '75k - 66k', '85k - 76k', '95k - 86k', '96k or more']
In [25]:
def age_group(age):
    if age <= 21:
        return 1
    if age <= 25:
        return 2
    if age <= 35:
        return 3
    if age <= 45:
        return 4
    if age <= 55:
        return 5
    if age <= 65:
        return 6
    if age > 65:
        return 7
In [26]:
def income_group(income):
    if income <= 35000:
        return 1
    if income <= 45000:
        return 2
    if income <= 65000:
        return 3
    if income <= 75000:
        return 4
    if income <= 85000:
        return 5
    if income <= 95000:
        return 6
    if income > 95000:
        return 7
In [27]:
def loyality_group(loyality):
    if loyality <= 20130000:
        return 1
    if loyality <= 20140000:
        return 2
    if loyality <= 20150000:
        return 3
    if loyality <= 20160000:
        return 4
    if loyality <= 20170000:
        return 5
    if loyality <= 20180000:
        return 6
    if loyality > 20180000:
        return 7
In [28]:
def clean_profile(profile_df):
    profile_df_cleaned = profile_df.copy()
    profile_df_cleaned = profile_df_cleaned.dropna()
    
    profile_df_cleaned[['user_gender_F','user_gender_M','user_gender_O']] = pd.get_dummies(profile_df_cleaned['gender'])
    
    profile_df_cleaned['user_id'] = profile_df_cleaned['id']   
    
    profile_df_cleaned['user_age_group'] = profile_df_cleaned['age'].apply(lambda x: age_group(x))
    profile_df_cleaned = pd.concat([profile_df_cleaned.drop('user_age_group', axis=1),pd.get_dummies(profile_df_cleaned['user_age_group'],prefix='user_age_group')], axis=1)
    
    profile_df_cleaned['user_loyality_group'] = profile_df_cleaned['became_member_on'].apply(lambda x: loyality_group(x))
    profile_df_cleaned = pd.concat([profile_df_cleaned.drop('user_loyality_group', axis=1),pd.get_dummies(profile_df_cleaned['user_loyality_group'],prefix='user_loyality_group')], axis=1)
    
    profile_df_cleaned['user_income_group'] = profile_df_cleaned['income'].apply(lambda x: income_group(x))
    profile_df_cleaned = pd.concat([profile_df_cleaned.drop('user_income_group', axis=1),pd.get_dummies(profile_df_cleaned['user_income_group'],prefix='user_income_group')], axis=1)
    profile_df_cleaned.drop(['id','age','became_member_on','gender','income'],axis=1,inplace=True)
    return profile_df_cleaned
In [29]:
profile_df = clean_profile(profile)
In [30]:
profile_df
Out[30]:
user_gender_F user_gender_M user_gender_O user_id user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7
1 1 0 0 0610b486422d4921ae7d2bf64640c50b 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
3 1 0 0 78afa995795e4d85b5d9ceeca43f5fef 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1
5 0 1 0 e2127556f4f64592b11af22de27a7932 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0
8 0 1 0 389bc3fa690240e798340f5a15918d5c 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0
12 0 1 0 2eeac8d8feae4a8cad5a6af0499a211d 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0
13 1 0 0 aa4862eba776480b8bb9c68455b8c2e1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0
14 0 1 0 e12aeaf2d47d42479ea1c4ac3d8286c6 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
15 1 0 0 31dda685af34476cad5bc968bdb01c53 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0
16 0 1 0 62cf5e10845442329191fc246e7bcea3 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
18 0 1 0 6445de3b47274c759400cd68131d91b4 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0
19 1 0 0 a448667f336b42c9a66fc5ffd5d73772 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0
20 1 0 0 440cf1fd7580490c971d8c651ed962af 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0
21 0 1 0 4b0da7e80e5945209a1fdddfe813dbe0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1
22 1 0 0 c27e0d6ab72c455a8bb66d980963de60 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0
24 0 1 0 f806632c011441378d4646567f357a21 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0
25 1 0 0 d058f73bf8674a26a95227db098147b1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0
27 1 0 0 c6c9884912c645429f3333f912b55f44 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
28 1 0 0 7429a044884842d6862f516c38b1156f 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
29 0 1 0 ebe7ef46ea6f4963a7dd49f501b26779 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0
30 0 1 0 5917d13f6fa04286abdf95f4d5cefb1e 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1
31 0 0 1 d1ede868e29245ea91818a903fec04c6 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
32 0 1 0 1e9420836d554513ab90eba98552d0a9 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0
33 1 0 0 868317b9be554cb18e50bc68484749a2 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0
34 0 1 0 f082d80f0aac47a99173ba8ef8fc1909 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
35 1 0 0 102e9454054946fda62242d2e176fdce 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0
37 0 1 0 8dabe2142cdf4013a6f4786edf8ab00f 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0
38 1 0 0 9f30b375d7bd4c62a884ffe7034e09ee 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
40 0 1 0 6e014185620b49bd98749f728747572f 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0
41 1 0 0 02c083884c7d45b39cc68e1314fec56c 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
42 0 1 0 c0d210398dee4a0895b24444a5fcd1d2 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
16963 1 0 0 8c3fbf6b89b248bb99b7a6ca628f401c 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0
16964 0 1 0 68213b08d99a4ae1b0dcb72aebd9aa35 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0
16965 0 1 0 e340cbf00a914f0c958577c0af36ed8a 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
16966 0 1 0 10316535e185400fb093c371d62254e3 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
16967 0 1 0 cec1cdc6b77e41abbdce8903c5522e7e 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
16968 0 1 0 2c6f50c1c07a444896e2a4e31d724f92 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0
16970 0 1 0 a2e6029e17b6466187a40b66e333a73e 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0
16971 1 0 0 6e71b66784844d1ab8376ac8ab096d4b 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0
16972 1 0 0 e2fd53ed790240c586b3188f23542cca 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
16973 0 1 0 08eb126ad33f447ca3ad076482445c05 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
16974 1 0 0 f88e91a11d8f405b9a47ad3741415b83 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0
16975 1 0 0 1b4df4b48bf64727a4c445909aea1251 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0
16976 1 0 0 122c0c2a3c2540848f8c3fdc37e97639 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0
16978 1 0 0 54bead4179c44b71acc4e8398181d183 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0
16979 1 0 0 a00058cf10334a308c68e7631c529907 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0
16981 0 1 0 1966fa40d2f84620b2b1b9b64f8e0209 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0
16983 1 0 0 ff737c250d2343729ade04c4f6eb1001 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0
16984 1 0 0 392d23b2c958493197f647bedfe4f418 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0
16985 0 1 0 97ee6e7a12fe4064b260fa48bdd0330f 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0
16986 1 0 0 bf3069b178fe40d789dd027901bc406b 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0
16987 0 1 0 76ddbd6576844afe811f1a3c0fbb5bec 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0
16988 0 1 0 f653cf2d8bba42d0a53c2937ee2e5893 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0
16990 1 0 0 79edb810789c447e8d212a324b44cc16 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0
16992 1 0 0 400d0536e8794cbb855b0d882d67cbda 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0
16993 0 1 0 cb23b66c56f64b109d673d5e56574529 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1
16995 1 0 0 6d5f3a774f3d4714ab0c092238f3a1d7 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0
16996 0 1 0 2cb4f97358b841b9a9773a7aa05a9d77 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0
16997 0 1 0 01d26f638c274aa0b965d24cefe3183f 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0
16998 1 0 0 9dc1421481194dcd9400aec7c9ae6366 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0
16999 1 0 0 e4052622e5ba45a8b96b59aba68cf068 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0

14825 rows × 24 columns

In [31]:
profile['income'].describe()
Out[31]:
count     14825.000000
mean      65404.991568
std       21598.299410
min       30000.000000
25%       49000.000000
50%       64000.000000
75%       80000.000000
max      120000.000000
Name: income, dtype: float64
In [32]:
profile['income'].hist()
Out[32]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fc91b9de400>
In [33]:
profile['age'].describe()
Out[33]:
count    17000.000000
mean        62.531412
std         26.738580
min         18.000000
25%         45.000000
50%         58.000000
75%         73.000000
max        118.000000
Name: age, dtype: float64
In [34]:
profile['age'].hist()
Out[34]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fc91ba2d7b8>
In [35]:
transcript_df['transaction_amount'].describe()
Out[35]:
count     290973
unique      5100
top             
freq      152653
Name: transaction_amount, dtype: object
In [37]:
transcript_protfolio_merged = pd.merge(transcript_df , portfolio_df, on='offer_id', how='outer')
In [38]:
transcript_protfolio_merged
Out[38]:
user_id offer_id transaction_amount offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4
0 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
1 d1a6fe4c241e4dbf8a4da6fd6c714ac5 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
2 da6c95e567f94dfdb54c16073807fcfe 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
3 d0be9ff460964c3398a33ad9b2829f3a 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
4 01f46a5191424005af436cdf48a5da7c 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
5 dbb37c0caad54f4a979a8121de79d0a2 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
6 3347e14dfe1f4526b14f3f849b2fc669 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
7 533435d3beb342c69c8d6a00947b7a4a 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
8 3f8b8ce1768d427588f442776e989b1e 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
9 481bcb3261a548bdb59df61d5e2a9ce3 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
10 d0de5df4a59845fc865659b10adfb80e 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
11 383a3a796f3242a7bcded87c3f4af1b7 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
12 0e5b96f4d09a4bad94da8b04b0ed9a4e 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
13 09b7c854b70f495d883b9004d83d0137 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
14 9244de96cbbd4aca92a3c71979e72b47 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
15 26a2ab820a234213818a1a15e15eafee 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
16 dfb467ce80d54545ae7ffc103b8fba35 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
17 d5cc312f1ef64b43aa37d07bfcec99d4 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
18 c1bb5a4b6d4a47ee8c5c009bbae056e3 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
19 c02c98b9c5e94a5ca3c63c415ea0ad35 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
20 7df6c8ca03074f69aed1e52ed9b89fe4 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
21 3977011340cf47d08a23c4b3d6f6aef6 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
22 b6d94c567b25454a9262c4f5c3ac996c 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
23 b6d94c567b25454a9262c4f5c3ac996c 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
24 fd45aee3900f4b3c88a35b53d0bf630b 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
25 667e1e1a4c8849d5879bc1d830e5a6b3 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
26 6cee7e5f6769472eb4151cc89eb039ce 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
27 ff5a3d93c39e40d0a56a65673350cfab 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
28 a9b0ed59ea614d80a17a5d436d887779 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
29 a9b0ed59ea614d80a17a5d436d887779 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
290943 f57fcd93d3e74e9b9bb9bc81a40a6612 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290944 3f935f28934b4151b6b7aadcb10c7a2b 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290945 3eb6aded21df4dcda69ba084c3dab2eb 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290946 7094d2b126a443369ad99924696810bd 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290947 7f0d9541dc284bb5b390c863644f04cd 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290948 14dc22654684405b9c4ece23bf234330 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290949 ec5800ee8ae040708487b6473b1fbefc 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290950 2f86dc0c78c543ce9f01561fd5798bd4 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290951 1c9b9ecc88ba4983b6ecec2fa2636d49 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290952 fef4f14201c44ddd915f504b7d88bf08 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290953 b8397fc0004f4d70bb0374139d1c6ea3 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290954 4a5960fb3b054de39299788f537162d9 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290955 df72761941ab427b9c8878508ad5814e 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290956 ec70faa2792f4ee19d67dca4957d285f 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290957 8d501b5bda454c188e837579f8a1c50d 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290958 73c27012b82d4d6da8bee4b0eea67aef 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290959 f428ef84305247ce98d2f7a59a70cc90 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290960 50b72821aa1a459698ad47ff4058c1ed 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290961 279318c88a9e451084f9c59a827f21a7 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290962 3964c9d017984279866a8496b9cd2156 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290963 8b5e47fbff5841518a90dee08cf42313 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290964 023a42cf62f742b795a975d56955e220 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290965 458339942fd54a30ab1c685d6d854358 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290966 2c2a1a03e7bf49febd39594ce9eb08bb 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290967 d1a824d43588413981d90146cc781a13 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290968 a3fa9c5ae07348f0ad9c6942a17e063b 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290969 eb1ebe497d654c17b2fa99e40eb3d2d0 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290970 7f0d9541dc284bb5b390c863644f04cd 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290971 0c027f5f34dd4b9eba0a25785c611273 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
290972 a6f84f4e976f44508c358cc9aba6d2b3 2298d6c36e964ae4a3e7e9706d1fb8c2 30 0 0 1 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

290973 rows × 27 columns

In [39]:
transcript_protfolio_profile_merged = pd.merge(transcript_protfolio_merged, profile_df, on='user_id', how='outer')
In [40]:
transcript_protfolio_profile_merged
Out[40]:
user_id offer_id transaction_amount offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4 user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7
0 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
1 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 6 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
2 78afa995795e4d85b5d9ceeca43f5fef 19.89 6 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
3 78afa995795e4d85b5d9ceeca43f5fef 17.78 6 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
4 78afa995795e4d85b5d9ceeca43f5fef 19.67 9 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
5 78afa995795e4d85b5d9ceeca43f5fef 29.72 10 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
6 78afa995795e4d85b5d9ceeca43f5fef 23.93 16 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
7 78afa995795e4d85b5d9ceeca43f5fef 21.72 21 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
8 78afa995795e4d85b5d9ceeca43f5fef 26.56 22 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
9 78afa995795e4d85b5d9ceeca43f5fef 5a8bc65990b245e5a138643cd4eb9837 7 1 0 0 3.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
10 78afa995795e4d85b5d9ceeca43f5fef 5a8bc65990b245e5a138643cd4eb9837 9 0 1 0 3.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
11 78afa995795e4d85b5d9ceeca43f5fef f19421c1d4aa40978ebb69ca19b0e20d 21 1 0 0 5.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
12 78afa995795e4d85b5d9ceeca43f5fef f19421c1d4aa40978ebb69ca19b0e20d 21 0 0 1 5.0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da6fd6c714ac5 9b98b8c7a33c4b65b9aebfe6a799e6d9 11 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
22 d1a6fe4c241e4dbf8a4da6fd6c714ac5 25.39 2 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
23 d1a6fe4c241e4dbf8a4da6fd6c714ac5 14.38 3 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
24 d1a6fe4c241e4dbf8a4da6fd6c714ac5 28.08 11 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
25 d1a6fe4c241e4dbf8a4da6fd6c714ac5 17.73 11 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
26 d1a6fe4c241e4dbf8a4da6fd6c714ac5 15.18 18 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
27 d1a6fe4c241e4dbf8a4da6fd6c714ac5 18.05 23 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
28 d1a6fe4c241e4dbf8a4da6fd6c714ac5 15.9 24 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
29 d1a6fe4c241e4dbf8a4da6fd6c714ac5 19.68 25 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
290943 bc0c484263b94b0896f20c5e4fdf3585 3f207df678b143eea3cee63160fa8bed 15 0 1 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290944 d727102ac242449ab15f1bd1af28e6ff 3f207df678b143eea3cee63160fa8bed 14 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290945 d727102ac242449ab15f1bd1af28e6ff 2298d6c36e964ae4a3e7e9706d1fb8c2 24 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290946 d727102ac242449ab15f1bd1af28e6ff 2298d6c36e964ae4a3e7e9706d1fb8c2 24 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290947 b52302342d674c9784218a66bf550cca 3f207df678b143eea3cee63160fa8bed 17 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290948 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 7 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290949 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 8 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290950 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290951 c00d1f6e8cba4787a00766232ae4711c 3f207df678b143eea3cee63160fa8bed 21 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290952 c00d1f6e8cba4787a00766232ae4711c 3f207df678b143eea3cee63160fa8bed 24 0 1 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290953 c00d1f6e8cba4787a00766232ae4711c ae264e3637204a6fb9bb56bc8210ddfd 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290954 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 0 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290955 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 14 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290956 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 15 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290957 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 24 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290958 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 24 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290959 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 5 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290960 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290961 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290962 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 20 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290963 27228232d0a649a1abb48246eb5616f9 2298d6c36e964ae4a3e7e9706d1fb8c2 7 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290964 27228232d0a649a1abb48246eb5616f9 2298d6c36e964ae4a3e7e9706d1fb8c2 7 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290965 1bfe13d2453c4185a6486c6817e0d568 ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290966 1bfe13d2453c4185a6486c6817e0d568 ae264e3637204a6fb9bb56bc8210ddfd 16 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290967 307f96a6ea9d40daa5978bf244dcd735 ae264e3637204a6fb9bb56bc8210ddfd 21 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290968 307f96a6ea9d40daa5978bf244dcd735 ae264e3637204a6fb9bb56bc8210ddfd 22 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290969 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 14 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290970 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 16 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290971 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 17 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290972 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 17 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

290973 rows × 50 columns

In [41]:
df = transcript_protfolio_profile_merged.copy()
In [42]:
df_calculated = df.copy()
df_calculated
Out[42]:
user_id offer_id transaction_amount offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4 user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7
0 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 0 0 1 0 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
1 78afa995795e4d85b5d9ceeca43f5fef 9b98b8c7a33c4b65b9aebfe6a799e6d9 6 0 0 1 7.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
2 78afa995795e4d85b5d9ceeca43f5fef 19.89 6 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
3 78afa995795e4d85b5d9ceeca43f5fef 17.78 6 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
4 78afa995795e4d85b5d9ceeca43f5fef 19.67 9 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
5 78afa995795e4d85b5d9ceeca43f5fef 29.72 10 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
6 78afa995795e4d85b5d9ceeca43f5fef 23.93 16 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
7 78afa995795e4d85b5d9ceeca43f5fef 21.72 21 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
8 78afa995795e4d85b5d9ceeca43f5fef 26.56 22 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
9 78afa995795e4d85b5d9ceeca43f5fef 5a8bc65990b245e5a138643cd4eb9837 7 1 0 0 3.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
10 78afa995795e4d85b5d9ceeca43f5fef 5a8bc65990b245e5a138643c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0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
24 d1a6fe4c241e4dbf8a4da6fd6c714ac5 28.08 11 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
25 d1a6fe4c241e4dbf8a4da6fd6c714ac5 17.73 11 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
26 d1a6fe4c241e4dbf8a4da6fd6c714ac5 15.18 18 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
27 d1a6fe4c241e4dbf8a4da6fd6c714ac5 18.05 23 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
28 d1a6fe4c241e4dbf8a4da6fd6c714ac5 15.9 24 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
29 d1a6fe4c241e4dbf8a4da6fd6c714ac5 19.68 25 0 0 0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
290943 bc0c484263b94b0896f20c5e4fdf3585 3f207df678b143eea3cee63160fa8bed 15 0 1 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290944 d727102ac242449ab15f1bd1af28e6ff 3f207df678b143eea3cee63160fa8bed 14 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290945 d727102ac242449ab15f1bd1af28e6ff 2298d6c36e964ae4a3e7e9706d1fb8c2 24 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290946 d727102ac242449ab15f1bd1af28e6ff 2298d6c36e964ae4a3e7e9706d1fb8c2 24 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0
290947 b52302342d674c9784218a66bf550cca 3f207df678b143eea3cee63160fa8bed 17 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290948 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 7 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290949 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 8 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290950 b52302342d674c9784218a66bf550cca ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
290951 c00d1f6e8cba4787a00766232ae4711c 3f207df678b143eea3cee63160fa8bed 21 1 0 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290952 c00d1f6e8cba4787a00766232ae4711c 3f207df678b143eea3cee63160fa8bed 24 0 1 0 4.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290953 c00d1f6e8cba4787a00766232ae4711c ae264e3637204a6fb9bb56bc8210ddfd 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290954 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 0 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
290955 c00d1f6e8cba4787a00766232ae4711c 2298d6c36e964ae4a3e7e9706d1fb8c2 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0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290960 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290961 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290962 27228232d0a649a1abb48246eb5616f9 ae264e3637204a6fb9bb56bc8210ddfd 20 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290963 27228232d0a649a1abb48246eb5616f9 2298d6c36e964ae4a3e7e9706d1fb8c2 7 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290964 27228232d0a649a1abb48246eb5616f9 2298d6c36e964ae4a3e7e9706d1fb8c2 7 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
290965 1bfe13d2453c4185a6486c6817e0d568 ae264e3637204a6fb9bb56bc8210ddfd 14 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290966 1bfe13d2453c4185a6486c6817e0d568 ae264e3637204a6fb9bb56bc8210ddfd 16 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290967 307f96a6ea9d40daa5978bf244dcd735 ae264e3637204a6fb9bb56bc8210ddfd 21 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290968 307f96a6ea9d40daa5978bf244dcd735 ae264e3637204a6fb9bb56bc8210ddfd 22 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290969 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 14 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290970 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 16 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290971 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 17 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
290972 307f96a6ea9d40daa5978bf244dcd735 2298d6c36e964ae4a3e7e9706d1fb8c2 17 0 1 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

290973 rows × 50 columns

In [43]:
def offer_success_calculation(df_calculated):

    df_calculated['offer_success'] = 0
    df_calculated['offer_amount'] = 0

    users = df_calculated['user_id'].unique()

    for user in users:
        
        df = df_calculated[df_calculated['user_id']==user]

        offers_list = df['offer_id'].unique()
        
        offers = []
        
        for i in offers_list:
            if (i != ''):
                if pd.notnull(i):
                    offers.append(i)



        for offer in offers:

            end = df[(df['offer_id']==offer)]['offer_days'].max()

            offer_idx = df[(df['offer_id']==offer)]

            received_day_index = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_received']).nlargest(1).index[0]
            received_day_value = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_received']).nlargest(1).iloc[0]

            viewed_day_index = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_viewed']).nlargest(1).index[0]
            viewed_day_value = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_viewed']).nlargest(1).iloc[0]

            completed_day_index = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_completed']).nlargest(1).index[0]
            completed_day_value = pd.to_numeric(df[(df['offer_id']==offer)]['offer_status_completed']).nlargest(1).iloc[0]

            start = df[(df['offer_id']==offer) & (df['offer_status_received']==1)]['offer_days'].max()
            
            duration = df[(df['offer_id']==offer)]['offer_duration'].iloc[0]
            
            diff = end - start

            received_day = offer_idx['offer_days'].loc[received_day_index]
            viewed_day = offer_idx['offer_days'].loc[viewed_day_index]
            completed_day = offer_idx['offer_days'].loc[completed_day_index]

            offer_amount = pd.to_numeric(df[(df['offer_days']==completed_day)]['transaction_amount']).max()

            summ = received_day_value + viewed_day_value + completed_day_value

            success=False

            if (diff <= duration) and (summ == 3) and (received_day <= viewed_day) and (viewed_day <= completed_day):

                success=True

            if (success==True):

                df_calculated.loc[offer_idx.index,'offer_success'] = 1

                if(offer_idx['offer_type_informational'].iloc[0] == 1):

                    df_calculated.loc[offer_idx.index,'offer_amount'] = 0

                if(offer_idx['offer_type_discount'].iloc[0] == 1):

                    df_calculated.loc[offer_idx.index,'offer_amount'] = offer_amount

                if(offer_idx['offer_type_bogo'].iloc[0] == 1):

                    df_calculated.loc[offer_idx.index,'offer_amount'] = offer_amount
    
    return df_calculated
In [45]:
df_calculated = offer_success_calculation(df_calculated)
In [46]:
df_calculated.to_csv('df_calculated.csv',index=False)
In [47]:
df_final = pd.read_csv('df_calculated.csv')
In [48]:
data = df_final.copy()

Data Analysis:

In [49]:
data = df_final.copy()
data.drop(['user_id','offer_id','transaction_amount'],axis=1,inplace=True)
data.dropna(inplace=True)
In [50]:
data.to_csv('data.csv',index=False)
In [51]:
data = pd.read_csv('data.csv')
In [52]:
success_data = data[data['offer_success']==1]
In [53]:
success_data
Out[53]:
offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4 user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7 offer_success offer_amount
7 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1 21.72
8 17 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 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1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1 21.62
87 14 0 0 1 5.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1 21.62
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
134756 24 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 23.07
134757 25 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 23.07
134758 28 0 0 1 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 23.07
134776 14 1 0 0 7.0 7.0 3.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 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0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79
134846 14 0 1 0 5.0 10.0 10.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79
134847 24 1 0 0 5.0 10.0 10.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79
134848 25 0 1 0 5.0 10.0 10.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79
134849 29 0 0 1 5.0 10.0 10.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79

57834 rows × 49 columns

In [54]:
success_data.to_csv('success_data.csv')
In [55]:
offer_columns = ['offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7','offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2','offer_id__2906b810c7d4411798c6938adc9daaa5','offer_id__3f207df678b143eea3cee63160fa8bed','offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0','offer_id__5a8bc65990b245e5a138643cd4eb9837','offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9','offer_id__ae264e3637204a6fb9bb56bc8210ddfd','offer_id__f19421c1d4aa40978ebb69ca19b0e20d','offer_id__fafdcd668e3743c1bb461111dcafc2a4']
offer_columns
Out[55]:
['offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7',
 'offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2',
 'offer_id__2906b810c7d4411798c6938adc9daaa5',
 'offer_id__3f207df678b143eea3cee63160fa8bed',
 'offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0',
 'offer_id__5a8bc65990b245e5a138643cd4eb9837',
 'offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9',
 'offer_id__ae264e3637204a6fb9bb56bc8210ddfd',
 'offer_id__f19421c1d4aa40978ebb69ca19b0e20d',
 'offer_id__fafdcd668e3743c1bb461111dcafc2a4']
In [56]:
success_data=pd.read_csv('success_data.csv').drop('Unnamed: 0',axis=1)
success_data
Out[56]:
offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4 user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7 offer_success offer_amount
0 17 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1 21.72
1 17 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1 21.72
2 21 0 0 1 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1 21.72
3 24 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 15.90
4 24 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0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 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 14.70
27 14 1 0 0 5.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1 21.62
28 14 0 1 0 5.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1 21.62
29 14 0 0 1 5.0 5.0 5.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1 21.62
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
57804 24 1 0 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 23.07
57805 25 0 1 0 7.0 10.0 10.0 1.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0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0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79
57833 29 0 0 1 5.0 10.0 10.0 1.0 0.0 0.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1 26.79

57834 rows × 49 columns

In [57]:
success_data[(success_data['offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7']==1)]
Out[57]:
offer_days offer_status_received offer_status_viewed offer_status_completed offer_duration offer_difficulty offer_reward offer_type_bogo offer_type_discount offer_type_informational offer_channel_web offer_channel_email offer_channel_mobile offer_channel_social offer_id__0b1e1539f2cc45b7b9fa7c272da2e1d7 offer_id__2298d6c36e964ae4a3e7e9706d1fb8c2 offer_id__2906b810c7d4411798c6938adc9daaa5 offer_id__3f207df678b143eea3cee63160fa8bed offer_id__4d5c57ea9a6940dd891ad53e9dbe8da0 offer_id__5a8bc65990b245e5a138643cd4eb9837 offer_id__9b98b8c7a33c4b65b9aebfe6a799e6d9 offer_id__ae264e3637204a6fb9bb56bc8210ddfd offer_id__f19421c1d4aa40978ebb69ca19b0e20d offer_id__fafdcd668e3743c1bb461111dcafc2a4 user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7 offer_success offer_amount
12 21 1 0 0 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0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.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 15.51
171 17 0 0 1 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 15.51
184 21 1 0 0 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1 29.07
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
34667 24 1 0 0 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 6.97
34668 26 0 1 0 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 6.97
34669 29 0 0 1 10.0 20.0 5.0 0.0 1.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.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 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1 18.04

3325 rows × 49 columns

In [58]:
successful_offers = []
for i in offer_columns:
    successful_offers.append(success_data[success_data[i]==1])
In [59]:
offer_features = ['offer_success','offer_amount','offer_days','offer_status_received','offer_status_viewed','offer_status_completed','offer_duration','offer_difficulty','offer_reward','offer_type_bogo','offer_type_discount','offer_type_informational','offer_channel_web','offer_channel_email','offer_channel_mobile','offer_channel_social']
successful_offers_demographic = []
for df in successful_offers:
    successful_offers_demographic.append(df.drop(offer_columns+offer_features,axis=1))
In [60]:
successful_offers_demographic[0]
Out[60]:
user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7
12 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0
13 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0
14 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0
48 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
49 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
50 0.0 0.0 1.0 0.0 0.0 0.0 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.0 0.0
34867 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0

3325 rows × 23 columns

In [61]:
successful_offers_demographic_sums = []
for i in range(0,10): 
    successful_offers_demographic_sums.append(successful_offers_demographic[i].sum(axis = 0))
    successful_offers_demographic_sums[i] = successful_offers_demographic_sums[i].append(pd.Series({'success_count' :successful_offers_demographic[i].shape[0]}))
    successful_offers_demographic_sums[i] = successful_offers_demographic_sums[i].append(pd.Series({'offer_id' :offer_columns[i].split('_')[3]}))
    
successful_offers_demographic_sums[0]
Out[61]:
user_gender_F                                        1559
user_gender_M                                        1668
user_gender_O                                          98
user_age_group_1                                       45
user_age_group_2                                       69
user_age_group_3                                      129
user_age_group_4                                      511
user_age_group_5                                      774
user_age_group_6                                      844
user_age_group_7                                      953
user_loyality_group_2                                  46
user_loyality_group_3                                 167
user_loyality_group_4                                 393
user_loyality_group_5                                1008
user_loyality_group_6                                1173
user_loyality_group_7                                 538
user_income_group_1                                    79
user_income_group_2                                   198
user_income_group_3                                  1102
user_income_group_4                                   623
user_income_group_5                                   539
user_income_group_6                                   476
user_income_group_7                                   308
success_count                                        3325
offer_id                 0b1e1539f2cc45b7b9fa7c272da2e1d7
dtype: object
In [62]:
successful_offers_demographic_sums[0]
Out[62]:
user_gender_F                                        1559
user_gender_M                                        1668
user_gender_O                                          98
user_age_group_1                                       45
user_age_group_2                                       69
user_age_group_3                                      129
user_age_group_4                                      511
user_age_group_5                                      774
user_age_group_6                                      844
user_age_group_7                                      953
user_loyality_group_2                                  46
user_loyality_group_3                                 167
user_loyality_group_4                                 393
user_loyality_group_5                                1008
user_loyality_group_6                                1173
user_loyality_group_7                                 538
user_income_group_1                                    79
user_income_group_2                                   198
user_income_group_3                                  1102
user_income_group_4                                   623
user_income_group_5                                   539
user_income_group_6                                   476
user_income_group_7                                   308
success_count                                        3325
offer_id                 0b1e1539f2cc45b7b9fa7c272da2e1d7
dtype: object
In [63]:
successful_offers_demographic_sums_df = pd.DataFrame(successful_offers_demographic_sums)
successful_offers_demographic_sums_df
Out[63]:
user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7 success_count offer_id
0 1559.0 1668.0 98.0 45.0 69.0 129.0 511.0 774.0 844.0 953.0 46.0 167.0 393.0 1008.0 1173.0 538.0 79.0 198.0 1102.0 623.0 539.0 476.0 308.0 3325.0 0b1e1539f2cc45b7b9fa7c272da2e1d7
1 4561.0 5755.0 154.0 291.0 374.0 888.0 1505.0 2148.0 2322.0 2942.0 214.0 583.0 1254.0 2673.0 3858.0 1888.0 714.0 1208.0 3324.0 1918.0 1146.0 930.0 1230.0 10470.0 2298d6c36e964ae4a3e7e9706d1fb8c2
2 2333.0 2920.0 114.0 107.0 112.0 309.0 818.0 1166.0 1351.0 1504.0 130.0 294.0 724.0 1461.0 1860.0 898.0 256.0 391.0 1785.0 1024.0 759.0 635.0 517.0 5367.0 2906b810c7d4411798c6938adc9daaa5
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3f207df678b143eea3cee63160fa8bed
4 3806.0 3327.0 107.0 141.0 145.0 457.0 945.0 1694.0 1678.0 2180.0 93.0 219.0 961.0 1993.0 2984.0 990.0 261.0 552.0 1990.0 1476.0 953.0 828.0 1180.0 7240.0 4d5c57ea9a6940dd891ad53e9dbe8da0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5a8bc65990b245e5a138643cd4eb9837
6 2462.0 2859.0 116.0 94.0 107.0 348.0 858.0 1313.0 1242.0 1475.0 120.0 227.0 809.0 1378.0 1943.0 960.0 255.0 365.0 1815.0 1024.0 738.0 648.0 592.0 5437.0 9b98b8c7a33c4b65b9aebfe6a799e6d9
7 3278.0 3312.0 119.0 150.0 152.0 473.0 985.0 1472.0 1655.0 1822.0 86.0 149.0 853.0 1878.0 2632.0 1111.0 316.0 579.0 2169.0 1205.0 902.0 722.0 816.0 6709.0 ae264e3637204a6fb9bb56bc8210ddfd
8 3935.0 4583.0 146.0 256.0 260.0 667.0 1071.0 1918.0 2044.0 2448.0 152.0 391.0 1052.0 2386.0 3276.0 1407.0 492.0 859.0 2785.0 1577.0 962.0 876.0 1113.0 8664.0 f19421c1d4aa40978ebb69ca19b0e20d
9 4764.0 5730.0 128.0 216.0 327.0 979.0 1404.0 2183.0 2617.0 2896.0 245.0 565.0 1510.0 2729.0 3666.0 1907.0 751.0 1138.0 3434.0 1857.0 1181.0 1036.0 1225.0 10622.0 fafdcd668e3743c1bb461111dcafc2a4
In [64]:
df = successful_offers_demographic_sums_df
df
Out[64]:
user_gender_F user_gender_M user_gender_O user_age_group_1 user_age_group_2 user_age_group_3 user_age_group_4 user_age_group_5 user_age_group_6 user_age_group_7 user_loyality_group_2 user_loyality_group_3 user_loyality_group_4 user_loyality_group_5 user_loyality_group_6 user_loyality_group_7 user_income_group_1 user_income_group_2 user_income_group_3 user_income_group_4 user_income_group_5 user_income_group_6 user_income_group_7 success_count offer_id
0 1559.0 1668.0 98.0 45.0 69.0 129.0 511.0 774.0 844.0 953.0 46.0 167.0 393.0 1008.0 1173.0 538.0 79.0 198.0 1102.0 623.0 539.0 476.0 308.0 3325.0 0b1e1539f2cc45b7b9fa7c272da2e1d7
1 4561.0 5755.0 154.0 291.0 374.0 888.0 1505.0 2148.0 2322.0 2942.0 214.0 583.0 1254.0 2673.0 3858.0 1888.0 714.0 1208.0 3324.0 1918.0 1146.0 930.0 1230.0 10470.0 2298d6c36e964ae4a3e7e9706d1fb8c2
2 2333.0 2920.0 114.0 107.0 112.0 309.0 818.0 1166.0 1351.0 1504.0 130.0 294.0 724.0 1461.0 1860.0 898.0 256.0 391.0 1785.0 1024.0 759.0 635.0 517.0 5367.0 2906b810c7d4411798c6938adc9daaa5
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3f207df678b143eea3cee63160fa8bed
4 3806.0 3327.0 107.0 141.0 145.0 457.0 945.0 1694.0 1678.0 2180.0 93.0 219.0 961.0 1993.0 2984.0 990.0 261.0 552.0 1990.0 1476.0 953.0 828.0 1180.0 7240.0 4d5c57ea9a6940dd891ad53e9dbe8da0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5a8bc65990b245e5a138643cd4eb9837
6 2462.0 2859.0 116.0 94.0 107.0 348.0 858.0 1313.0 1242.0 1475.0 120.0 227.0 809.0 1378.0 1943.0 960.0 255.0 365.0 1815.0 1024.0 738.0 648.0 592.0 5437.0 9b98b8c7a33c4b65b9aebfe6a799e6d9
7 3278.0 3312.0 119.0 150.0 152.0 473.0 985.0 1472.0 1655.0 1822.0 86.0 149.0 853.0 1878.0 2632.0 1111.0 316.0 579.0 2169.0 1205.0 902.0 722.0 816.0 6709.0 ae264e3637204a6fb9bb56bc8210ddfd
8 3935.0 4583.0 146.0 256.0 260.0 667.0 1071.0 1918.0 2044.0 2448.0 152.0 391.0 1052.0 2386.0 3276.0 1407.0 492.0 859.0 2785.0 1577.0 962.0 876.0 1113.0 8664.0 f19421c1d4aa40978ebb69ca19b0e20d
9 4764.0 5730.0 128.0 216.0 327.0 979.0 1404.0 2183.0 2617.0 2896.0 245.0 565.0 1510.0 2729.0 3666.0 1907.0 751.0 1138.0 3434.0 1857.0 1181.0 1036.0 1225.0 10622.0 fafdcd668e3743c1bb461111dcafc2a4
In [65]:
df = successful_offers_demographic_sums_df
In [66]:
gender_group = ['user_gender_F', 'user_gender_M', 'user_gender_O']
gender_group
Out[66]:
['user_gender_F', 'user_gender_M', 'user_gender_O']
In [67]:
gender_group_info = ['Male','Female', 'Other']
gender_group_info
Out[67]:
['Male', 'Female', 'Other']
In [68]:
age_group = ['user_age_group_1', 'user_age_group_2', 'user_age_group_3', 'user_age_group_4', 'user_age_group_5', 'user_age_group_6', 'user_age_group_7']
age_group
Out[68]:
['user_age_group_1',
 'user_age_group_2',
 'user_age_group_3',
 'user_age_group_4',
 'user_age_group_5',
 'user_age_group_6',
 'user_age_group_7']
In [69]:
age_group_info = ['21 or younger','25 - 22', '35 - 26', '45 - 36', '55 - 46', '65 - 56', '66 or older']
age_group_info
Out[69]:
['21 or younger',
 '25 - 22',
 '35 - 26',
 '45 - 36',
 '55 - 46',
 '65 - 56',
 '66 or older']
In [70]:
loyality_group = ['user_loyality_group_1', 'user_loyality_group_2', 'user_loyality_group_3', 'user_loyality_group_4', 'user_loyality_group_5', 'user_loyality_group_6', 'user_loyality_group_7']
loyality_group
Out[70]:
['user_loyality_group_1',
 'user_loyality_group_2',
 'user_loyality_group_3',
 'user_loyality_group_4',
 'user_loyality_group_5',
 'user_loyality_group_6',
 'user_loyality_group_7']
In [71]:
loyality_group_info = ['2013 or newer','2014 - 2013', '2015 - 2014', '2016 - 2015', '2017 - 2016', '2018 - 2017', '2018 or newer']
loyality_group_info
Out[71]:
['2013 or newer',
 '2014 - 2013',
 '2015 - 2014',
 '2016 - 2015',
 '2017 - 2016',
 '2018 - 2017',
 '2018 or newer']
In [72]:
income_group = ['user_income_group_1', 'user_income_group_2', 'user_income_group_3', 'user_income_group_4', 'user_income_group_5', 'user_income_group_6', 'user_income_group_7']
income_group
Out[72]:
['user_income_group_1',
 'user_income_group_2',
 'user_income_group_3',
 'user_income_group_4',
 'user_income_group_5',
 'user_income_group_6',
 'user_income_group_7']
In [73]:
income_group_info = ['35k or less','45k - 36k', '65k - 46k', '75k - 66k', '85k - 76k', '95k - 86k', '96k or more']
income_group_info
Out[73]:
['35k or less',
 '45k - 36k',
 '65k - 46k',
 '75k - 66k',
 '85k - 76k',
 '95k - 86k',
 '96k or more']
In [75]:
# Create figure with secondary y-axis
from plotly.subplots import make_subplots

fig = make_subplots(specs=[[{"secondary_y": True}]])

# Add traces
for (feature, info) in zip(gender_group, gender_group_info):
    fig.add_trace(
        go.Scatter(x=list(df.offer_id), y=df[feature], name=info),

    )

    # Add figure title
fig.update_layout(
    title_text="User Gender For Each Offer"
)
# Set x-axis title
fig.update_xaxes(title_text="Offer")
# Set y-axes titles
fig.update_yaxes(title_text="Count Of User Group Per Successful Offer")

fig.show()
In [76]:
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])

# Add traces
for (feature, info) in zip(age_group, age_group_info):
    fig.add_trace(
        go.Scatter(x=list(df.offer_id), y=df[feature], name=info),

    )
# Add figure title
fig.update_layout(
    title_text="User Age Group For Each Offer"
)
# Set x-axis title
fig.update_xaxes(title_text="Offer")
# Set y-axes titles
fig.update_yaxes(title_text="Count Of User Group Per Successful Offer")

fig.show()
In [77]:
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])

# Add traces
for (feature, info) in zip(income_group, income_group_info):
    fig.add_trace(
        go.Scatter(x=list(df.offer_id), y=df[feature], name=info),

    )

    # Add figure title
fig.update_layout(
    title_text="User Income Group For Each Offer"
)
# Set x-axis title
fig.update_xaxes(title_text="Offer")
# Set y-axes titles
fig.update_yaxes(title_text="Number Of User Group Per Successful Offer")

fig.show()
In [78]:
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])
loyality_group.pop(0) # no users in group 1
loyality_group_info.pop(0) # no users in group 1
# Add traces
for (feature, info) in zip(loyality_group, loyality_group_info):
    fig.add_trace(
        go.Scatter(x=list(df.offer_id), y=df[feature], name=info),

    )

    # Add figure title
fig.update_layout(
    title_text="User Loyality Group For Each Offer"
)
# Set x-axis title
fig.update_xaxes(title_text="Offer")
# Set y-axes titles
fig.update_yaxes(title_text="Number Of User Group Per Successful Offer")

fig.show()
In [79]:
#Mostly user_gender_M, user_age_group_7, user_income_group_3, user_loyality_group_6

Conclusion

After studying all the data and the graphs generated after thorough investigation and transformations of the givine data, I can say the following:
All Offers are succesfful for this user demographic:
Mostly Female, 65 years of age or more, Earns between 45000 and 65000 and Joined recently in 2018 - 2017 period.